<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use common\models\Template;
/* @var $this yii\web\View */
/* @var $model common\models\Template */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="template-form">

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'keyword')->textInput(['maxlength' => true, 'placeholder'=>'请用小写加下划线的格式, 例如：user_query']) ?>

    <?= $form->field($model, 'tpl_id')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'content')->textarea(['rows' => 6]) ?>

    <?= $form->field($model, 'type')->dropDownList(Template::itemAlias('type')) ?>

    <?= $form->field($model, 'status')->dropDownList(Template::itemAlias('status')) ?>

    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? '新增' : '更新', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
